package com.example.core.utils

import android.content.Context
import com.example.core.BaseApplication
import com.example.mylibrary.R

object CacheUtil {

    private val context = BaseApplication.application
    private val sp = context.run {
        getSharedPreferences(context.getString(R.string.app_name), Context.MODE_PRIVATE)
    }

    fun save(key: String, value: String) {
        sp.edit().putString(key, value).apply()
    }

    fun get(key: String) = sp.getString(key, "")
}